
#ifndef DRAGLAYERFILTER_H
#define DRAGLAYERFILTER_H

#include <BMap>
#include <BEventFilter>

using namespace BWE;

class DragLayerFilter : public BEventFilter
{
public:
	DragLayerFilter();
	~DragLayerFilter();

protected:
	void applyPartDraging(const BPoint& pos);

protected:
	void slotZoomChanged();
	void slotWidgetMoved(BObject* object, const BValue& value);
	void slotWidgetSelectionChanged(BObject* object, const BValue& value);

private:
	virtual void attached(BWidget* widget);
	virtual void detached(BWidget* widget);

	virtual void updateEvent(const BEvent& event);

	virtual void freshEvent(const BEvent& event);
	virtual void paintEvent(const BEvent& event);

	virtual void mouseEnterEvent(const BMouseEvent& mouseEvent);
	virtual void mouseLeaveEvent(const BMouseEvent& mouseEvent);
	virtual void mousePressEvent(const BMouseEvent& mouseEvent);
	virtual void mouseReleaseEvent(const BMouseEvent& mouseEvent);
	virtual void mouseMoveEvent(const BMouseEvent& mouseEvent);

	virtual void mouseWheelEvent(const BMouseEvent& mouseEvent);

private:
	bool				_draging;
	Part				_dragPart;
	BPoint				_dragPoint;
	BRect				_dragRect;
	bool				_dirtyRects;
	BMap<Part, BRect>	_partRectMap;
	BArray<BRect>		_originRects;

};

#endif
